Wavefront Geometry Import Converter

This geometry import converter reads in Wavefront 'OBJ' format files in their entirety, including vertex, normal and texture coordinates, as well as grouping and smoothing information. Many companies which sell 3D models provide their datasets in the OBJ file format, so you can use this converter to read in these data files and be guaranteed nice rendered results.

The converter will also read material definitions from a Wavefront material file (typically which has a file extension '.mtl') if the material file is referenced within the Wavefront geometry file (typically which has a file extension '.obj') using the 'mtllib' keyword. If one or more Wavefront material files are listed on a single line then all will be read into memory for possible reference by the geometry file.

The converter first reads the entire file into memory; this includes the vertex, normal and texture coordinate lists, their indice lists, all group names, material names and texture names, and the smoothing groups assigned to each polygon. Next, the converter computes new vertex normals for polygons that don't have any normals and that have a non-zero smoothing group assigned to them. If no smoothing groups are found then the converter optionally creates smoothed vertex normals based on the angle between abutting polygon faces. As a last step, the polygonal data is separated into separate objects based on a user-chosen criteria.

NOTES:

If any texture map names are found in the file (ie: if the 'usemap ' command is specified in the file) and the 'surf-name-src' option of this converter is set to 'use-mat-name' then texture definitions will be automatically created for these texture names and will be assigned to their corresponding surfaces. NOTE:: you can distinguish these textured surfaces because the texture map name is appended to the end of the surface name (the surface and texture names are separated by three underscores '_').

If one or more group names are found on a 'g' line then they are appended all together to form the group name used internally (ie: 'g all airplane tail_fin').